﻿using System;
using System.Drawing;

namespace MarioMapEditor
{
    class ObGrass : ObObject
    {
        public enum GRASS {Grass =15};

        public ObGrass()
        {
            Width   = 2;
            Height  = 1;
        }

        public ObGrass(GRASS nid)
        {
            ID = (int)nid;
            Width   = 2;
            Height  = 1;
        }

        public override bool SetID(int nID)
        {
            if (checkType(nID))
            {
                ID = nID;
                return true;
            }
            return false;
        }

        public static bool checkType(int objectID)
        {
            if (Enum.IsDefined(typeof(GRASS), objectID))
            {
                return true;
            }
            return false;
        }

        public override Bitmap GetBitmap()
        {
            if (!checkType(ID))
            {
                return null;
            }
            var src = Properties.Resources.Grass;
            return MainForm.ResizeImage(src, new Size(Width * MainForm.TileSize, Height * MainForm.TileSize));
        }
    }
}
